package group2assignone.ucm.manager;

import group2assignone.func.UCCtoALAdapter;
import group2assignone.model.Flight;
import group2assignone.ucm.UCController;
import group2assignone.view.manager.CreateFlightView;

/**
 * Use case to change UI to create flight view
 * @author group2
 */
public class UCUICreateFlight implements UCController {

    private Flight f = new Flight();
    private CreateFlightView flightView = new CreateFlightView();

    /**
     *
     * @param view
     */
    public UCUICreateFlight(CreateFlightView view) {
        //System diplays create flight user interface
        this.flightView = view;
    }

    @Override
    public void run() {
        flightView.go();
        UCCreateFlightNext uccfc = new UCCreateFlightNext(flightView, f);
        flightView.setCreateAL(new UCCtoALAdapter(uccfc));

        UCCreateFlightEdit uccfe = new UCCreateFlightEdit(flightView, f);
        flightView.setEditAL(new UCCtoALAdapter(uccfe));

        UCCreateFlight uccfd = new UCCreateFlight(flightView, f);
        flightView.setDoneAL(new UCCtoALAdapter(uccfd));

        UCCreateFlightCancel uccfca = new UCCreateFlightCancel(flightView, f);
        flightView.setCancelAL(new UCCtoALAdapter(uccfca));
    }
}
